#!/bin/bash
clear

RED="\033[1;31m"
GREEN="\033[1;32m"
YELLOW="\033[1;33m"
BLUE="\033[1;34m"
PLAIN="\033[0m"

if [ "${EUID}" -ne 0 ]; then
    echo -e "${RED}You need to run this script as root!${PLAIN}" && exit 1
fi

read -p "Enter username: " USERNAME
egrep "^$USERNAME" /etc/passwd &>/dev/null
if [ $? -ne 0 ]; then
    echo -e "${RED}Username not exist!${PLAIN}" && exit 2
fi
passwd -u $USERNAME

clear
echo "";
echo "================== [ UNLOCK CLIENT PASSWORD ]"
echo -e "${YELLOW}Successfully unlock user password${PLAIN}"
echo "---------------------------------------------"
echo "Copyright 2021 Cybertize, Allright Reserved."
echo "============================================="
echo "";
